const path = require('path');
const fs = require('fs');

//当前文件所在目录的绝对路径
console.log(__dirname);
//当前文件的绝对路径
console.log(__filename);
//join表示将传入参数拼接成路径，第几个参数表示第几级目录
// const src = path.join('a','b','c')
const src = path.join('/a','/b','/c')
console.log(src);

fs.readFile('../a.txt', 'utf-8', (err, data)=> {
  if(err){
    console.log(err);
  }
  console.log(data);
})